#ifndef OXFORDWORD_H
#define OXFORDWORD_H

#include <QObject>
#include <QMetaType>
#include "serializable.h"
#include "oxford-word-usage-variant.h"
#include "oxford-word-usage-example.h"
#include "oxford-idiom.h"

namespace Oxford
{

class Word : public Core::Serializable
{
    Q_OBJECT
    Q_PROPERTY(QString word READ word)

    Q_PROPERTY(bool is3000 READ is3000)
    Q_PROPERTY(bool isAcademic READ isAcademic)

    Q_PROPERTY(QString speechPart READ speechPart)

    Q_PROPERTY(QString gbTranscription READ gbTranscription)
    Q_PROPERTY(QString gbPronunciation READ gbPronunciation)
    Q_PROPERTY(QString usTranscription READ usTranscription)
    Q_PROPERTY(QString usPronunciation READ usPronunciation)

    Q_PROPERTY(QList<WordUsageVariant> variants READ variants)
    Q_PROPERTY(QList<WordIdiom> idioms READ idioms)
private:
    QString _word;

    bool _is3000;
    bool _isAcademic;

    QString _speechPart;

    QString _gbTranscription;
    QString _gbPronunciation;
    QString _usTranscription;
    QString _usPronunciation;

    QList<WordUsageVariant> _variants;
    QList<WordIdiom> _idioms;
friend class
    Parser;

public:
    Word();
    Word(const Word& other);

    QString word() const
    {
        return _word;
    }

    bool is3000() const
    {
        return _is3000;
    }

    bool isAcademic() const
    {
        return _isAcademic;
    }

    QString speechPart() const
    {
        return _speechPart;
    }

    QString gbTranscription() const
    {
        return _gbTranscription;
    }

    QString gbPronunciation() const
    {
        return _gbPronunciation;
    }

    QString usTranscription() const
    {
        return _usTranscription;
    }

    QString usPronunciation() const
    {
        return _usPronunciation;
    }

    const QList<WordUsageVariant>& variants() const
    {
        return _variants;
    }

    const QList<WordIdiom>& idioms() const
    {
        return _idioms;
    }

    bool isValid() const;
    ObjectString toString() const;
    static Word fromString(QString data);
};

}

#endif // OXFORDWORD_H
